<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="${ctx}/styles/gsjcss/common.css">
<title>国省自检--${fns:getConfig('productName')}</title>
<script type="text/javascript">
	function btnClick(){
		var url = '${ctx}/diseaseTreatment/search.do?projectId=${fns:encodeParamUrl(projectId)}&menuId=${fns:encodeParamUrl(menuId)}';
		var data = {};
		if($('#btnSearch').length>0){ //有搜索按钮的情况下 获取条件进行搜索
			//将条件提取出来  存入data中  然后ajax请求   得到数据
			data['retrieval'] = getJson('condition');
			loadData(url,data);
		} else {
			loadData(url,data);
		}
	}
	//ajax执行成功之后的回调方法
	function loadDataToTable(data){
		var attData = data['att'];
		loadAttachment(attData);
		//根据电子化信息化字段 判断是否选择了某个单位进行查询
		if(data['orgName'] != ""){
			var checkResult = data['checkResult'];
			var content = '<table style="width:98%;text-align:center;margin-top:5px;" border="1"><thead>'+
			'<th>序号</th><th>单位名称</th><th>及时处置</th><th>作业计划</th><th>记录齐全</th>'+
			'<th>验收完整</th><th>检查得分</th><th>系统完善度</th></thead>'+
			'<tbody><td>1</td>'+
			'<td>'+data['orgName']+'</td>'+
			'<td>'+imgRight+'</td>';
			for(var i = 0;i<checkResult.length;i++){
				if(checkResult[i] == '1'){
					content += '<td>'+imgRight+'</td>';
				} else {
					content += '<td>'+imgError+'</td>'
				}
			}
			content +='<td class="sumTd">'+data['sum']+'</td>'+
			'<td class="perTd">'+data['percentage']+'%</td>'+
			'</tbody></table>';
			$('#checkResult').append(content);
		}
	}
</script>
</head>
<body>
	<div id="x_top"></div>
	<tags:message content="${msg}" />
	<c:if test="${not empty checkTable.id}">
		<div style="text-align:center">
			<a href="javascript:void(0);" class="btn btn-primary" onclick="downWord('${ctx}/diseaseTreatment/downWord.do?projectId=${fns:encodeParamUrl(projectId)}&menuId=${fns:encodeParamUrl(menuId)}');" id= "btnDown" role="button" ><div id="x_v"></div></a>
		</div>
	</c:if>
	<form id="checkForm" class="form-horizontal"  method="POST"  name="checkForm" action="${ctx}/diseaseTreatment/save.do?left=${fns:encodeParam(left)}&parentId=${fns:encodeParam(parentId)}&projectId=${fns:encodeParam(projectId)}&menuId=${fns:encodeParam(menuId)}&leftChild=${fns:encodeParam(leftChild)}">
		<input type="hidden" name="token" value="${token}">
		<div id="show">
			<div id="showTable" class="showTable">
				<jsp:include page="/WEB-INF/views/check/common.jsp"/> 
				<div class="model">
					<div>
						<legend>三、检查条件及设置</legend>
						<div class="content-title" id="condition">
							<div style="float:left;margin-right:10px;">
							<span>养护检查记录:</span>
							<select name="orgId" id="orgId">
								<option value="">请选择</option>
								<c:forEach items="${fns:getMaintenanceOrg()}" var="maintenanceOrg"  varStatus="idxStatus">
									<option value="${maintenanceOrg.id}">${maintenanceOrg.orgName}</option>
								</c:forEach>
							</select>
								<span>各项资料完整总分<font style="color:red;">*</font>：</span>
								<input type='text' name = "yearFull" id="yearFull" value="1" class="required conInput"/>
							</div>
							<div id="x_s" style="float:right">
								<div class="x_ico"></div>
								<a href="#javascript:void(0)" onclick= "btnClick();"  id= "btnSearch" role="button" >搜索&nbsp;</a>
							</div>
						</div>
					</div>
				</div>
				<div class="model">
					<div>
					<legend>四、检索结果</legend>
						<div class="content-title">
							<div class="tabbox">
								<div class="tab">
									<c:forEach items="${childMenuList}" var="menu"  varStatus="idxStatus">
										<c:if test="${idxStatus.index >= 2}">
											<a href="javascript:;" ${idxStatus.index==2?"class='on'":""}>${menu.name}</a>
										</c:if>
									</c:forEach>
							    </div>
							    <div class="content">
							    	<ul>
							    		<c:forEach items="${childMenuList}" var="menu"  varStatus="idxStatus">
							    			<c:if test="${idxStatus.index >= 2}">
								    			<li>
								    				<table style="width:98%;text-align:center;margin-top:5px;" border="1" id="${menu.tag}">
								    					<thead>
									    					<th>序号</th>
									    					<th>操作</th>
									    					<th>发文单位</th>
									    					<th>上传用户</th>
									    					<th>文件名</th>
									    					<th>发文日期</th>
									    					<th>上传日期</th>
									    					<th>文件大小</th>
									    					<th>文件类型</th>
								    					</thead>
								    					<tbody>
								    						
								    					</tbody>
								    				</table>
								    			</li>
								    		</c:if>
							    		</c:forEach>
							        </ul>
							    </div>
							</div>
						</div>
					</div>
				</div>
				<div class="model">
					<div>
						<legend>五、检查评分</legend>
						<div class="content-title" id="checkResult">
						</div>
					</div>
				</div>
				<div class="model">
					<div class="content-btn">
						<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存" />
						&nbsp;&nbsp;&nbsp;&nbsp;
						<input id="btnCancel" class="btn" type="button" value="返 回" onclick="toBack()" />
					</div>
				</div>
			</div>
		</div>
	</form>
	<script src="${ctxStatic}/js/check/checkCommon.js" type="text/javascript"></script>
</body>
</html>